package com.gitee.gphomework.pattern.commandpattern.receiver;

/**
 * Created on 2020/3/18
 * Title: Ftp命令执行类
 * Description: Ftp命令执行类
 * Copyright: Copyright(c) 2020
 * Company:
 *
 * @author yifeng
 */
public class FtpCmdReceiver {

    private static final FtpCmdReceiver INSTANCE = new FtpCmdReceiver();

    public static FtpCmdReceiver getInstance() {
        return INSTANCE;
    }

    public void cwd() {
        System.out.print("命令： CWD /score\n");
        System.out.print("响应： 250 Command okay.\n");
    }

    public void pass() {
        System.out.print("命令： PASS password\n");
        System.out.print("响应: 230 User logged in, proceed.\n");
    }

    public void pasv() {
        System.out.print("命令： PASV\n");
        System.out.print("响应： 227 Debuging Passive Mode (15,73,48,57,159,174).\n");
    }

    public void port() {
        System.out.print("命令： PORT \n");
        System.out.print("响应： 200 Port command successful\n");
    }

    public void quit() {
        System.out.print("命令： QUIT\n");
        System.out.print("响应： 200 Closes connection.\n");
    }

    public void retr() {
        System.out.print("命令：RETR class-score.xls\n");
        System.out.print("响应：150 Opening data connection.\n");
        System.out.print("客户端开始接受文件...\n");
        System.out.print("客户端文件下载完成!\n");
    }

    public void size() {
        System.out.print("命令：SIZE class-score.xls\n");
        System.out.print("响应：213 <64512>");
    }

    public void user() {
        System.out.print("命令：USER yifeng\n");
        System.out.print("响应：331 User name okay, need password.\n");
    }

    private FtpCmdReceiver() {
    }

}
